﻿using LPLS.Commons.DBModule;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LPLS.DBEntities.ConfigModels.DataCollectionConfigModule.DataCollectionType.DB
{

    [DatabaseKey(DatabaseEnum.CollectionConfigDB)]
    [SugarTable(nameof(DBCollectionConfig))]
    /// <summary>
    /// 采集数据库连接配置
    /// </summary>
    public  class DBCollectionConfig
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int Id { get; set; }
        public string ConnectionString { get; set; } 
        public DbType DBDbType { get; set;  }
        public bool IsAutoCloseConnection { get; set; } = true;
        [SugarColumn(IsIgnore =true)]
        public SqlSugarClient DBSqlSugarClient { get; set; }


        public string DBCollectionName { get; set; }

        [Navigate(NavigateType.OneToMany, nameof(DBTableConfig.DBCollectionID))]
        public  List<DBTableConfig> DBVarColumnConfigs { get; set; } 

    }
}
